Django Migrations 101

Darren Jones

Since version 1.7, Django has come with built-in support for database migrations. In Django, database migrations usually go hand in hand with models: whenever you code up a new model, you also generate a migration to create the necessary table in the database. However, migrations can do much more.

With this course you’ll get comfortable with Django migrations and learn how to create database tables without writing any SQL, how to automatically modify your database after you changed your models, and how to revert changes made to your database.

What’s Included:

Related Learning Paths:

About Darren Jones

With 20 years as a teacher of music technology, Darren is keen to bring his skills to the Python table.

» More about Darren

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Participant Comments

Avatar image for rodrimedeiros

rodrimedeiros on Feb. 22, 2022

Really nice course. For me two important things that I learned from this course that I consider a senior behavior are:

1 - makemigrations per app - thinking for example like commits in git where you try to change only one thing and commit in order to make easy go one step back. Same thinking for migrations.

2 - define a descriptive names for migrations - it’s nice to look to the migration and know what is going on. And where I have to go if I wanna to go back to a previous schema.

And about you guys, What did you consider an important learning in this course?

Avatar image for Silver

Silver on Dec. 6, 2019

Nice Course!! Thanks!

Avatar image for sion

sion on July 29, 2019

Good stuff, well presented thank you

Avatar image for Edgar Isai

Edgar Isai on May 10, 2019

Like it, you went straight to the point.

Avatar image for Indran Naidoo

Indran Naidoo on April 9, 2019

Succinct and relevant…no fluff!!!

Avatar image for Daniel

Daniel on April 7, 2019

Great series of videos. Hope to see more Django video series in the future.

Avatar image for Anonymous

Anonymous on March 31, 2019

Nice. Sweet and Short. Need more of these on Django

« Browse All Courses